home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / e_os300b / resource / eos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-02  |  26.0 KB  |  483 lines

  1. #ifndef _EOS_H
  2. #define _EOS_H
  3.  
  4.  
  5. #define Off 0
  6. #define On  1
  7.  
  8.  
  9. #ifdef __cplusplus
  10. extern "C"
  11. {
  12. #endif
  13.  
  14.  
  15. //╔══════════════════════════════════════════════════════════════════════════╗
  16. //║                                                                          ║
  17. //║ EOS Functions                                                            ║
  18. //║                                                                          ║
  19. //╚══════════════════════════════════════════════════════════════════════════╝
  20.  
  21.  
  22. //╔══════════════════════════════════════════════════════════════════════════╗
  23. //║                                                                          ║
  24. //║                                System                                    ║
  25. //║                                                                          ║
  26. //╚══════════════════════════════════════════════════════════════════════════╝
  27.  
  28.  
  29. //┌──────────────────────────────────────────────────────────────────────────┐
  30. //│Exit Error   Restore initial Video mode , interrupts , free all reserved  │
  31. //│             memory ,stop music if played and exit (with error code 1)    │
  32. //│             with a error message                                         │
  33. //│                                                                          │
  34. //└──────────────────────────────────────────────────────────────────────────┘
  35. void Exit_Error(char *Msg_Error);
  36. #pragma aux Exit_Error "_*" parm [edx] modify [eax]
  37.  
  38.  
  39. //┌──────────────────────────────────────────────────────────────────────────┐
  40. //│Use Int 08   Use Int 08 (IRQ 0) to count frame rate and have a stable     │
  41. //│             vertical retrace                                             │
  42. //│                                                                          │
  43. //└──────────────────────────────────────────────────────────────────────────┘
  44. void Use_Int_08();
  45. #pragma aux Use_Int_08 "_*" modify [eax]
  46.  
  47.  
  48. //┌──────────────────────────────────────────────────────────────────────────┐
  49. //│Change Synchro Int 08   Change frequency for Interupt 08                  │
  50. //│                        Defaults frequency is 70Hz                        │
  51. //│                                                                          │
  52. //└──────────────────────────────────────────────────────────────────────────┘
  53. void Change_Synchro_Int_08(short Value);
  54. #pragma aux Change_Synchro_Int_08 "_*" modify [eax] parm [bx]
  55.  
  56.  
  57. //┌──────────────────────────────────────────────────────────────────────────┐
  58. //│Restore Video Mode   Restore the inital video which is be active at the   │
  59. //│                     start of the program                                 │
  60. //│                                                                          │
  61. //└──────────────────────────────────────────────────────────────────────────┘
  62. void Restore_Video_Mode();
  63. #pragma aux Restore_Video_Mode "_*" modify [eax]
  64.  
  65. //┌──────────────────────────────────────────────────────────────────────────┐
  66. //│Detect Windows       Detect If Windows is running                         │
  67. //│                                                                          │
  68. //│Other Registers Change : None                                             │
  69. //│                                                                          │
  70. //└──────────────────────────────────────────────────────────────────────────┘
  71. #define Windows_3x           3
  72. #define Windows_95           4
  73. unsigned char Detect_Windows();
  74. #pragma aux Detect_Windows "_*" modify [eax] value [al]
  75.  
  76.  
  77. //┌──────────────────────────────────────────────────────────────────────────┐
  78. //│Direct Send          Write a text directly to video ram . Color allowed   │
  79. //│                                                                          │
  80. //│Command : 0,0      = end                                                  │
  81. //│          0,1..255 = color                                                │
  82. //│          13       = first colonne                                        │
  83. //│          10       = next ligne                                           │
  84. //│                                                                          │
  85. //└──────────────────────────────────────────────────────────────────────────┘
  86. void Direct_Send(char *Msg);
  87. #pragma aux Direct_Send "_*" modify [eax edx] parm [edx]
  88.  
  89.  
  90. //╔══════════════════════════════════════════════════════════════════════════╗
  91. //║                                                                          ║
  92. //║                                 Files                                    ║
  93. //║                                                                          ║
  94. //╚══════════════════════════════════════════════════════════════════════════╝
  95.  
  96.  
  97. //┌──────────────────────────────────────────────────────────────────────────┐
  98. //│Load Internal file   Load a file which is link with LLINK                 │
  99. //│                     if the file is not present the program stop and      │
  100. //│                     display a error message                              │
  101. //│                                                                          │
  102. //└──────────────────────────────────────────────────────────────────────────┘
  103. char *Load_Internal_File(char *File_Name,long *Size_File);
  104. #pragma aux Load_Internal_File "_*" modify [eax ecx edx esi edi] value [eax] parm [edx] [ecx]
  105.  
  106.  
  107. //┌──────────────────────────────────────────────────────────────────────────┐
  108. //│Load Internal file Handle  Load a file which is link with LLINK           │
  109. //│                           if the file is not present the program stop    │
  110. //│                           and display a error message                    │
  111. //│                                                                          │
  112. //└──────────────────────────────────────────────────────────────────────────┘
  113. char *Load_Internal_File_Handle(char *File_Name,long *Size_File,long *Handle_File);
  114. #pragma aux Load_Internal_File_Handle "_*" modify [eax ecx edx esi edi] value [eax] parm [edx] [ecx] [edi]
  115.  
  116.  
  117. //┌──────────────────────────────────────────────────────────────────────────┐
  118. //│Load External file   Load a external file and uncompress it if it has     │
  119. //│                     been compress with Diet 1.44                         │
  120. //│                                                                          │
  121. //└──────────────────────────────────────────────────────────────────────────┘
  122. char *Load_External_File(char *File_Name,long *Size_File);
  123. #pragma aux Load_External_File "_*" modify [eax ecx edx esi edi] value [eax] parm [edx] [ecx]
  124.  
  125.  
  126. //┌──────────────────────────────────────────────────────────────────────────┐
  127. //│Load External file Handle  Load a external file and uncompress it if it   │
  128. //│                           has been compress with Diet 1.44               │
  129. //│                                                                          │
  130. //└──────────────────────────────────────────────────────────────────────────┘
  131. char *Load_External_File_Handle(char *File_Name,long *Size_File,long *Handle_File);
  132. #pragma aux Load_External_File_Handle "_*" modify [eax ecx edx esi edi] value [eax] parm [edx] [ecx] [edi]
  133.  
  134.  
  135. //┌──────────────────────────────────────────────────────────────────────────┐
  136. //│Write External File  Save a File on a Disk                                │
  137. //│                                                                          │
  138. //└──────────────────────────────────────────────────────────────────────────┘
  139. long Write_External_File(char *File_Name,long *Addr_File,long *Size_File);
  140. #pragma aux Write_External_File "_*" modify [eax ebx ecx edx esi edi] value [eax] parm [edx] [esi] [ecx]
  141.  
  142. //╔══════════════════════════════════════════════════════════════════════════╗
  143. //║                                                                          ║
  144. //║                           Memory Allocation                              ║
  145. //║                                                                          ║
  146. //╚══════════════════════════════════════════════════════════════════════════╝
  147.  
  148. //┌──────────────────────────────────────────────────────────────────────────┐
  149. //│DeAllocate Memory Handle  Free the allocate memory with this handle       │
  150. //│                                                                          │
  151. //└──────────────────────────────────────────────────────────────────────────┘
  152. void DeAllocate_Memory_Handle(long Handle_Memory);
  153. #pragma aux DeAllocate_Memory_Handle "_*" modify [eax edi] parm [edi]
  154.  
  155. //┌──────────────────────────────────────────────────────────────────────────┐
  156. //│Allocate Selector   Create a new selector                                 │
  157. //│                                                                          │
  158. //└──────────────────────────────────────────────────────────────────────────┘
  159. long Allocate_Selector(char *VRAM_Addr, long VRAM_Size);
  160. #pragma aux Allocate_Selector "_*" modify [eax esi edi] parm [esi edi] value [eax]
  161.  
  162. //┌──────────────────────────────────────────────────────────────────────────┐
  163. //│DeAllocate Selector       Free a selector                                 │
  164. //│                                                                          │
  165. //└──────────────────────────────────────────────────────────────────────────┘
  166. long DeAllocate_Selector(long Handle_selector);
  167. #pragma aux DeAllocate_Selector "_*" modify [eax ebx] parm [ebx]
  168.  
  169.  
  170. //╔══════════════════════════════════════════════════════════════════════════╗
  171. //║                                                                          ║
  172. //║                              Synchronization                             ║
  173. //║                                                                          ║
  174. //╚══════════════════════════════════════════════════════════════════════════╝
  175.  
  176.  
  177. //┌──────────────────────────────────────────────────────────────────────────┐
  178. //│Wait Vbl   Wait the vertical retrace                                      │
  179. //│                                                                          │
  180. //└──────────────────────────────────────────────────────────────────────────┘
  181. long Wait_Vbl();
  182. #pragma aux Wait_Vbl "_*" modify [eax] value [eax]
  183.  
  184.  
  185. //╔══════════════════════════════════════════════════════════════════════════╗
  186. //║                                                                          ║
  187. //║                              Diamond Player                              ║
  188. //║                                                                          ║
  189. //╚══════════════════════════════════════════════════════════════════════════╝
  190. #define  No_Card    0
  191. #define  Sb_10      01h
  192. #define  Sb_15      02h
  193. #define  Sb_20      03h
  194. #define  Sb_Pro     04h
  195. #define  Sb_16      05h
  196. #define  Sb_Awe     06h
  197. #define  Gravis     10h
  198. #define  Gravis_Max 11h
  199. #define  Gravis_Ace 12h
  200. #define  Gravis_Pnp 13h
  201. #define  WSS        20h
  202.  
  203. //┌──────────────────────────────────────────────────────────────────────────┐
  204. //│Detect Sound Card   Detect with the environment variable the sound        │
  205. //│                    card installed                                        │
  206. //│                                                                          │
  207. //└──────────────────────────────────────────────────────────────────────────┘
  208. int Detect_Sound_Card(int Display,int *Port,int *Irq,int *Dma,int *Infos);
  209. #pragma aux Detect_Sound_Card "_*"  modify [eax ebx ecx edx esi edi] parm [ecx] [ebx] [edx] [esi] [edi]
  210.  
  211.  
  212. //┌──────────────────────────────────────────────────────────────────────────┐
  213. //│Load Module   Load a module & initialize into the memory                  │
  214. //│                                                                          │
  215. //└──────────────────────────────────────────────────────────────────────────┘
  216. long Load_Module(char *File_Name,unsigned char type,int Replay,int Sfx_Channel);
  217. #pragma aux Load_Module "_*" modify [eax ebx ecx edx esi edi] value [eax] parm [edx] [eax] [ebx] [ecx]
  218.  
  219.  
  220. //┌──────────────────────────────────────────────────────────────────────────┐
  221. //│Play Module   Start playing the module                                    │
  222. //│                                                                          │
  223. //└──────────────────────────────────────────────────────────────────────────┘
  224. void Play_Module();
  225. #pragma aux Play_Module "_*" modify [eax]
  226.  
  227.  
  228. //┌──────────────────────────────────────────────────────────────────────────┐
  229. //│Stop Module   Stop playing the module                                     │
  230. //│                                                                          │
  231. //└──────────────────────────────────────────────────────────────────────────┘
  232. void Stop_Module();
  233. #pragma aux Stop_Module "_*" modify [eax]
  234.  
  235.  
  236. //┌──────────────────────────────────────────────────────────────────────────┐
  237. //│Clear Module   Unload the module from memory                              │
  238. //│                                                                          │
  239. //└──────────────────────────────────────────────────────────────────────────┘
  240. void Clear_Module();
  241. #pragma aux Clear_Module "_*" modify [eax]
  242.  
  243.  
  244. //┌──────────────────────────────────────────────────────────────────────────┐
  245. //│Set Volume   Set the master volume of the module                          │
  246. //│                                                                          │
  247. //└──────────────────────────────────────────────────────────────────────────┘
  248. void Set_Volume(unsigned char Volume,unsigned char Sfx_Volume);
  249. #pragma aux Set_Volume "_*" modify [eax ecx edx] parm [cl] [dl]
  250.  
  251. //┌──────────────────────────────────────────────────────────────────────────┐
  252. //│Play Sample   Play a sample include into the module                       │
  253. //│                                                                          │
  254. //└──────────────────────────────────────────────────────────────────────────┘
  255. void Play_Sample(int Num_Sample,int Frequence,int Voice);
  256. #pragma aux Play_Sample "_*" modify [eax ebx ecx edx] parm [ebx] [ecx] [edx]
  257.  
  258.  
  259. //┌──────────────────────────────────────────────────────────────────────────┐
  260. //│Get Info   Get information about the module when playing                  │
  261. //│                                                                          │
  262. //└──────────────────────────────────────────────────────────────────────────┘
  263. void Get_Info(unsigned char *Position,unsigned char *Pattern,unsigned char *Note,unsigned char *Volume,unsigned char *Sfx_Volume);
  264. #pragma aux Get_Info "_*" modify [eax ebx ecx edx esi] parm [eax] [ebx] [ecx] [edx] [esi]
  265.  
  266.  
  267. //┌──────────────────────────────────────────────────────────────────────────┐
  268. //│Set Pattern  Set the current position of the playing module               │
  269. //│                                                                          │
  270. //└──────────────────────────────────────────────────────────────────────────┘
  271. void Set_Pattern(int Position,int Note);
  272. #pragma aux Set_Pattern "_*" parm [ebx] [ecx] modify [eax ecx edx]
  273.  
  274.  
  275. //╔══════════════════════════════════════════════════════════════════════════╗
  276. //║                                                                          ║
  277. //║ Monochrome display                                                       ║
  278. //║                                                                          ║
  279. //╚══════════════════════════════════════════════════════════════════════════╝
  280.  
  281. //┌──────────────────────────────────────────────────────────────────────────┐
  282. //│Set Mono   Force On/Off the display of all the Monochrome Function        │
  283. //│                                                                          │
  284. //└──────────────────────────────────────────────────────────────────────────┘
  285. void Set_Mono(unsigned char Value);
  286. #pragma aux Set_Mono "_*" parm [ebx] modify [eax]
  287.  
  288.  
  289. //┌──────────────────────────────────────────────────────────────────────────┐
  290. //│Set String Mono   Display a string on the Monochrome adapter              │
  291. //│                                                                          │
  292. //└──────────────────────────────────────────────────────────────────────────┘
  293. void Set_String_Mono(char *Msg,int X,int Y);
  294. #pragma aux Set_String_Mono "_*" parm [edx] [ebx] [ecx] modify [eax ebx ecx edx]
  295.  
  296.  
  297. //┌──────────────────────────────────────────────────────────────────────────┐
  298. //│Set Value Mono   Display A Word in Hexadecimal on the Monochrome adapter  │
  299. //│                                                                          │
  300. //└──────────────────────────────────────────────────────────────────────────┘
  301. void Set_Value_Mono(long Value,int X,int Y);
  302. #pragma aux Set_Value_Mono "_*" parm [edx] [ebx] [ecx] modify [eax ebx ecx edx]
  303.  
  304.  
  305. //╔══════════════════════════════════════════════════════════════════════════╗
  306. //║                                                                          ║
  307. //║ EOS Library                                                              ║
  308. //║                                                                          ║
  309. //╚══════════════════════════════════════════════════════════════════════════╝
  310.  
  311.  
  312. //╔══════════════════════════════════════════════════════════════════════════╗
  313. //║                                                                          ║
  314. //║ VESA                                                                     ║
  315. //║                                                                          ║
  316. //╚══════════════════════════════════════════════════════════════════════════╝
  317.  
  318. //┌──────────────────────────────────────────────────────────────────────────┐
  319. //│Init Vesa   Initialize A Vesa video mode                                  │
  320. //│                                                                          │
  321. //└──────────────────────────────────────────────────────────────────────────┘
  322. char *Init_Vesa(int Vesa_Mode);
  323. #pragma aux Init_Vesa parm [eax] modify [eax ebx ecx edx esi edi] value [eax]
  324.  
  325.  
  326. //┌──────────────────────────────────────────────────────────────────────────┐
  327. //│Init Vesa2  Initialize A Vesa 2.0 Linear FrameBuffer mode                 │
  328. //│                                                                          │
  329. //└──────────────────────────────────────────────────────────────────────────┘
  330. char *Init_Vesa2(long Vesa_Mode,long Vesa_Size);
  331. #pragma aux Init_Vesa2 parm [eax] [ecx] modify [eax ebx ecx edx esi edi] value [eax]
  332.  
  333.  
  334. //┌──────────────────────────────────────────────────────────────────────────┐
  335. //│Init Vesa Bank  Init the Automatic Bank Switching                         │
  336. //│                                                                          │
  337. //└──────────────────────────────────────────────────────────────────────────┘
  338. long Init_Vesa_Bank();
  339. #pragma aux Init_Vesa_Bank modify [eax ebx ecx edx esi edi] value [ebx]
  340.  
  341.  
  342. //╔══════════════════════════════════════════════════════════════════════════╗
  343. //║                                                                          ║
  344. //║ FLI32                                                                    ║
  345. //║                                                                          ║
  346. //╚══════════════════════════════════════════════════════════════════════════╝
  347.  
  348. extern char Fli_Err;
  349. extern char Fli_Svga;
  350. extern char Fli_Swap;
  351. extern char Fli_ReStart;
  352. extern char Fli_Loop;
  353. extern char Fli_TrackDisk;
  354. extern char Fli_Last_Frame;
  355. extern char Fli_Ligne_Shl;
  356. extern int  Fli_Selector;
  357. extern long Fli_Delay;
  358. extern long Fli_Buffer;
  359. extern long Fli_Scr_X;
  360. extern long Fli_Scr_Y;
  361. extern long Fli_Decal_Y;
  362. extern long Fli_Decal_X;
  363. extern long Fli_Current_Frame;
  364.  
  365. //┌──────────────────────────────────────────────────────────────────────────┐
  366. //│                                                                          │
  367. //│ Load_Fli(*adrs_file_name)                                                │
  368. //│                                                                          │
  369. //│ Cette routine charge et vérifie le header d'un fichier FLI ou FLC        │
  370. //│                                                                          │
  371. //└──────────────────────────────────────────────────────────────────────────┘
  372. long Load_Fli(char *File_Name);
  373. #pragma aux Load_Fli modify [eax ebx ecx edx esi edi] value [eax] parm [edx]
  374.  
  375. //┌──────────────────────────────────────────────────────────────────────────┐
  376. //│                                                                          │
  377. //│ First_Frame_Fli()                                                        │
  378. //│                                                                          │
  379. //│ Cette routine décompresse la première image d'un fichier FLI ou FLC      │
  380. //│                                                                          │
  381. //└──────────────────────────────────────────────────────────────────────────┘
  382. void First_Frame_Fli();
  383. #pragma aux First_Frame_Fli modify [eax ebx ecx edx esi edi]
  384.  
  385. //┌──────────────────────────────────────────────────────────────────────────┐
  386. //│                                                                          │
  387. //│ Next_Frame_Fli()                                                         │
  388. //│                                                                          │
  389. //│ Cette routine décompresse la prochaine image d'un fichier FLI ou FLC     │
  390. //│                                                                          │
  391. //└──────────────────────────────────────────────────────────────────────────┘
  392. void Next_Frame_Fli();
  393. #pragma aux Next_Frame_Fli modify [eax ebx ecx edx esi edi]
  394.  
  395. //┌──────────────────────────────────────────────────────────────────────────┐
  396. //│                                                                          │
  397. //│ Dispose_Fli()                                                            │
  398. //│                                                                          │
  399. //│ Cette routine libère la mémoire allouée par la fonction Load_Fli         │
  400. //│                                                                          │
  401. //└──────────────────────────────────────────────────────────────────────────┘
  402. void Dispose_Fli();
  403. #pragma aux Dispose_Fli modify [eax ebx ecx edx esi edi]
  404.  
  405.  
  406. //╔══════════════════════════════════════════════════════════════════════════╗
  407. //║                                                                          ║
  408. //║ SNAP                                                                     ║
  409. //║                                                                          ║
  410. //╚══════════════════════════════════════════════════════════════════════════╝
  411.  
  412. //┌──────────────────────────────────────────────────────────────────────────┐
  413. //│Snap        Grab a 256 Colors screen in Non-Mode and save it in IFF format│
  414. //│            Scroll Lock to lunch it                                       │
  415. //└──────────────────────────────────────────────────────────────────────────┘
  416.  
  417. //┌──────────────────────────────────────────────────────────────────────────┐
  418. //│Init Snap   Initialize the screen grabber . (You can change the int 09    │
  419. //│            function Use_Int_09 after this Init                           │
  420. //│                                                                          │
  421. //└──────────────────────────────────────────────────────────────────────────┘
  422. void Init_Snap();
  423.  
  424. //┌──────────────────────────────────────────────────────────────────────────┐
  425. //│Snap IFF    Grab the current Screen from Video RAM                        │
  426. //│                                                                          │
  427. //└──────────────────────────────────────────────────────────────────────────┘
  428. void Snap_Iff();
  429.  
  430. //┌──────────────────────────────────────────────────────────────────────────┐
  431. //│Save IFF    Save a buffer to IFF                                          │
  432. //│                                                                          │
  433. //└──────────────────────────────────────────────────────────────────────────┘
  434. void Save_Iff(int X,int Y,char *File_Name,char *Addr_File);
  435. #pragma aux Save_Iff parm [eax] [ebx] [edx] [esi] modify [eax ebx edx esi]
  436.  
  437.  
  438. //╔══════════════════════════════════════════════════════════════════════════╗
  439. //║                                                                          ║
  440. //║ MEMORY                                                                   ║
  441. //║                                                                          ║
  442. //╚══════════════════════════════════════════════════════════════════════════╝
  443.  
  444. //┌──────────────────────────────────────────────────────────────────────────┐
  445. //│Init_Memory    Turn the display memory on                                 │
  446. //│                                                                          │
  447. //│In :                                                                      │
  448. //│                                                                          │
  449. //│Out :                                                                     │
  450. //│                                                                          │
  451. //│Other Registers Change : None                                             │
  452. //│                                                                          │
  453. //└──────────────────────────────────────────────────────────────────────────┘
  454. void Init_Memory();
  455.  
  456.  
  457. //╔══════════════════════════════════════════════════════════════════════════╗
  458. //║                                                                          ║
  459. //║ The 32bit debugger                                                       ║
  460. //║                                                                          ║
  461. //╚══════════════════════════════════════════════════════════════════════════╝
  462.  
  463. void Debug();
  464. void Debug_Back();
  465.  
  466. void Break_Point();
  467. #pragma aux Break_Point = "int 3";
  468.  
  469. //╔══════════════════════════════════════════════════════════════════════════╗
  470. //║                                                                          ║
  471. //║ The EOS Emulation when using WATCON                                      ║
  472. //║                                                                          ║
  473. //╚══════════════════════════════════════════════════════════════════════════╝
  474.  
  475. void Init_EOS();
  476. #pragma aux     Init_EOS "*"
  477.  
  478.  
  479. #ifdef __cplusplus
  480. };
  481. #endif
  482.  
  483. #endif